package com.iven.xie.designpattern.memento.demo;

/**
 * 发起人
 *
 * @author xiezhendong
 * @date 2021/8/3
 */
public class Originator {
    private String state;

    public void setState(String state) {
        this.state = state;
    }

    public String getState() {
        return state;
    }

    public Memento createMemento() {
        return new Memento(state);
    }

    public void restoreMemento(Memento m) {
        this.setState(m.getState());
    }
}
